import 'package:dio/dio.dart';
class AuthInterceptor extends Interceptor{


  @override
  void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
    // 实际项目中从安全存储获取token
    const token =  'your_access_token';
    if(token.isNotEmpty){
      options.headers['Authorization']='Bearer $token';
    }

    // 添加公共参数
    options.queryParameters.addAll({
      'device_id':'mobile123',
      'platform':';flutter'
    });
    handler.next(options);
  }



}